package com.briup.cms.service.impl;

import com.briup.cms.bean.Carousel;
import com.briup.cms.dao.CarouseIExtendMapper;
import com.briup.cms.dao.CarouselMapper;
import com.briup.cms.exception.CustomerException;
import com.briup.cms.service.ICarouselService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description  轮播图模块service实现类
 * @Author lining
 * @Date 2021/7/18 16:08
 * @Version 1.0.0
 */
@Service
public class CarouselServiceImpl implements ICarouselService {
    @Autowired
    private CarouseIExtendMapper mapper;
    @Override
    public PageInfo<Carousel> findAll(int pageNum, int pageSize) throws CustomerException {
        //1.设置分页信息
        PageHelper.startPage(pageNum,pageSize);
        List<Carousel> list = mapper.findAllCarousel();
        PageInfo<Carousel> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }

    @Override
    public void deleteById(int id) throws CustomerException {

    }

    @Override
    public void saveCarousel(Carousel carousel) throws CustomerException {

    }

    @Override
    public void updateCarousel(Carousel carousel) throws CustomerException {

    }

    @Override
    public List<Carousel> findYesCarousel() throws CustomerException {
        return null;
    }
}
